package com.hlhj.carview.adapter

import android.content.Context
import android.support.v4.view.PagerAdapter
import android.text.Layout
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.hlhj.carview.LoadtNet
import com.hlhj.carview.R
import kotlinx.android.synthetic.main.banner_lo.view.*

/**
 *NeverMore
 *2020/9/16
 **/
class MuPagerAdp(private val datas:ArrayList<String>, private val c:Context):PagerAdapter() {
    override fun instantiateItem(container: ViewGroup, position: Int): Any {
        val view=LayoutInflater.from(c).inflate(R.layout.banner_lo,null)
        view.itemImg.LoadtNet(datas[position])
        container.addView(view)
        return view

    }
    override fun isViewFromObject(view: View, `object`: Any): Boolean {
        return view==`object`
    }

    override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
//        super.destroyItem(container, position, `object`)
    }
    override fun getCount(): Int {
        return datas.size
    }
}